import React from "react";
import Tabbar from "./components/Tabbar";

import { Switch, Route, Redirect, useRouteMatch } from "react-router-dom";
import Movies from "./movies/index";
import Videos from "./videos/index";
import Mini from "./mini/index";
import Show from "./show/index";
import Mine from "./mine/index";

const Index = () => {
  // console.log(props);

  const { url } = useRouteMatch();

  return (
    <>
      <Switch>
        <Redirect from={url} to={`${url}/movies`} exact></Redirect>
        <Route path={`${url}/movies`} component={Movies}></Route>
        <Route path={`${url}/videos`} component={Videos}></Route>
        <Route path={`${url}/mini`} component={Mini}></Route>
        <Route path={`${url}/show`} component={Show}></Route>
        <Route path={`${url}/mine`} component={Mine}></Route>
      </Switch>
      <Tabbar />
    </>
  );
};

export default Index;
